Component({
  data: {
    selected: 0,
    color: "#999999",
    selectedColor: "#D4444A",
    list: [{
      pagePath: "/pages/home/home",
      iconPath: "/images/homegrey.png",
      selectedIconPath: "/images/home.png",
      text: "首页"
    }, 
    {
      pagePath: "/pages/stores/storeinfo",
      iconPath: "/images/scanun.png",
      selectedIconPath: "/images/scan.png",
      text: "扫码"
    },
    {
      pagePath: "/pages/password/password",
      iconPath: "/images/messageun.png",
      selectedIconPath: "/images/messageun.png",
      text: "互动"
    },
    {
      pagePath: "/pages/my/my",
      iconPath: "/images/mine_un.png",
      selectedIconPath: "/images/mine.png",
      text: "我的"
    }
    ]
  },
  attached() {
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    }
  }
})